<?php get_instance()->view('common/header');?>
<style>
    .content-btn-box,.content-box{margin-top:10px;}
    .container {
        width: 100%;
    }
    .add-tag-btn{line-height: 40px;}
    .option-item {
        margin-bottom: 5px;
        position: relative;
    }
    .del-tag-btn{font-size: 14px;line-height: 36px;display: block;margin-bottom: 4px;}
    .del-tag-btn a{color: red;}
</style>
<div class="page-container home">
    <?php get_instance()->view('common/sidebar');?>
    <div class="page-content-wrapper">
        <div class="page-content">
            <div class="row">
                <div class="col-md-12">
                    <!-- BEGIN PAGE TITLE & BREADCRUMB-->
                    <h3 class="page-title"> <?php echo $title;?></h3>
                    <ul class="page-breadcrumb breadcrumb">
                        <li class="btn-group"> <a class="btn default ml_5 return" href="<?php echo $backUrl;?>"><i class="fa fa-chevron-left"></i> 返回</a> </li>
                        <li> <i class="fa fa-home"></i> <a href="<?php echo $backUrl;?>"> 商品列表  <i class="fa fa-angle-right"></i> </a></li>
                        <li><a href="javascript:void(0);"><?php echo $add ? '添加' : '编辑';?></a></li>
                    </ul>
                    <!-- END PAGE TITLE & BREADCRUMB-->
                </div>
            </div>
            <div class="row">
	            <div class="col-md-12">
                    <div class="tabbable tabbable-custom tabbable-custom-profile">
                        <ul class="nav nav-tabs">
                            <li class="active"><a href="#tab_1_1" data-toggle="tab">基本信息</a></li>
                            <li class=""><a href="#tab_1_2" data-toggle="tab">标签属性</a></li>
                            <li class=""><a href="#tab_1_3" data-toggle="tab">商品详情</a></li>
                </ul>
                         <form action="<?php echo getUrl('material/home/save')?>" class="form-horizontal" method="post" id="main-form" novalidate="novalidate">
                             <input type="hidden" value="<?php echo $backUrl;?>" class="form-control" name="back_url"/>
                            <div class="tab-content">
                                <!--基本信息-->
                                <div class="tab-pane active" id="tab_1_1">
                                    <div class="table-actions-wrapper " style="float: right"></div>
                                    <div class="table-responsive">
                                        <div class="table-container">
                                            <div class="form-body">
                                                <div class="form-group">
                                                    <label class="control-label col-md-2">商品封面图<span class="required">*</span></label>
                                                    <div class="col-md-6">
                                                        <div class="cropitMaster-box" style="width:124px;height:124px;&quot;">
                                                            <img style="width:100%;height:100%;" id="icn-img" alt="" src="<?php echo ! $add ? $info['icon']['og'] : getDefaultImg();?>">
                                                        </div>
                                                        <a class="upload-btn" href="javascript:void(0);">选择上传图片（124*124）</a>
                                                        <input type="hidden" name="icon" id="pic" >
                                                    </div>
                                                    <script type="text/javascript">
                                                        $(function () {
                                                            cropitMaster({
                                                                uploadBtn:$('.upload-btn'),
                                                                height:'124px',
                                                                width:'124px',
                                                                complete:function(btn,data){
                                                                    $('#icn-img').attr('src', data);
                                                                    $('#pic').val(data).change();
                                                                }
                                                            });
                                                        })
                                                    </script>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-2">分类<span class="required">*</span></label>
                                                    <div class="col-md-3">
                                                        <select class="form-control required category">
                                                            <option value="0">请选择一级分类</option>
                                                            <?php foreach ($category as $k => $v):?>
                                                                <option value="<?php echo $v['id']?>" <?php if (! $add && $catInfo['parent_id'] == $v['id']):?> selected <?php endif;?> ><?php echo $v['cat_name']?></option>
                                                            <?php endforeach;?>
                                                        </select>
                                                    </div>
                                                    <div class="col-md-3">
                                                        <select class="form-control required catId" name="cat_id">
                                                            <option value="0">请选择二级分类</option>
                                                            <?php if (! $add): foreach ($cat as $k => $v):?>
                                                                <option value="<?php echo $v['id']?>" <?php if ($v['id'] == $info['cat_id']):?> selected <?php endif;?> ><?php echo $v['cat_name']?></option>
                                                            <?php endforeach; endif;?>
                                                        </select>
                                                    </div>
                                                    <script type="text/javascript">
                                                        $(function () {
                                                            $(".category").change(function () {
                                                                var vl = $(this).val();
                                                                var url = "<?php echo getUrl('material/home/getCategoryList')?>";
                                                                App.blockUI({message:'加载中...'});
                                                                $.ajax(url, {
                                                                    dataType:'json',
                                                                    type:'post',
                                                                    data:{parentId:vl},
                                                                    error:function(){
                                                                        show_message({status:0, message:'请求超时'});
                                                                        App.unblockUI();
                                                                    },
                                                                    timeout:60000,
                                                                    success:function(data,textStatus,jqXHR){
                                                                        App.unblockUI();
                                                                        var html = '<option value="0">请选择二级分类</option>';
                                                                        if (data.status == 0){
                                                                            show_message(data);
                                                                        }else {
                                                                            $.each(data.data, function (key, obj) {
                                                                                html += '<option value="' + obj.id + '">' + obj.cat_name + '</option>';
                                                                            });
                                                                        }
                                                                        $(".catId").html(html);
                                                                        $("select").select2();
                                                                    }
                                                                });
                                                            });
                                                        })
                                                    </script>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-2">商品名称<span class="required">*</span></label>
                                                    <div class="col-md-6">
                                                        <input class="form-control required" placeholder="输入商品名称" name="name" type="text" value="<?php echo ! $add ? $info['name'] : '';?>">
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-2">售价<span class="required">*</span></label>
                                                    <div class="col-md-6">
                                                        <input class="form-control required number" placeholder="输入商品售价" name="price" type="text" value="<?php echo ! $add ? $info['price'] : '';?>">
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-2">市场价<span class="required">*</span></label>
                                                    <div class="col-md-6">
                                                        <input class="form-control required number" placeholder="输入商品市场价" name="market_price" type="text" value="<?php echo ! $add ? $info['market_price'] : '';?>">
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-2">促销价</label>
                                                    <div class="col-md-6">
                                                        <input class="form-control number" placeholder="输入商品促销价" name="promote_price" type="text" value="<?php echo ! $add ? $info['promote_price'] : '';?>">
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-2">促销开始时间</label>
                                                    <div class="col-md-6">
                                                        <input class="form-control" placeholder="促销开始时间" name="promote_start_date" dp type="text" value="<?php echo ! $add ? dateFormat($info['promote_start_date']) : '';?>">
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-2">促销结束时间</label>
                                                    <div class="col-md-6">
                                                        <input class="form-control" placeholder="促销结束时间" name="promote_end_date" dp type="text" value="<?php echo ! $add ? dateFormat($info['promote_end_date']) : '';?>">
                                                    </div>
                                                </div>
                                                <div class="form-group" id="quantity">
                                                    <label class="control-label col-md-2">库存<span class="required">*</span></label>
                                                    <div class="col-md-6">
                                                        <input class="form-control required number" name="quantity" type="text" value="<?php echo ! $add ? $info['quantity'] : '0';?>">
                                                    </div>
                                                </div>
                                                <!-- 运费  -->
                                                <div class="form-group">
                                                    <label class="control-label col-md-2">重量（克）<span class="required">*</span></label>
                                                    <div class="col-md-6">
                                                        <input class="form-control required number" placeholder="设置商品重量" name="weight" type="text" value="<?php echo ! $add ? $info['weight'] : '0';?>">
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-2">是否包邮<span class="required">*</span></label>
                                                    <div class="col-md-6" style="margin-left: 18px;">
                                                        <div class="radio-list">
                                                            <label class="radio-inline"><input name="is_shipping" <?php if( ! $add && $info['is_shipping'] == 1):?> checked <?php elseif($add):?> checked <?php endif;?> value="1" type="radio"> 不包邮 </label>
                                                            <label class="radio-inline"><input name="is_shipping" <?php if( ! $add && $info['is_shipping'] == 2):?> checked<?php endif;?> value="2" type="radio"> 包邮 </label>
                                                        </div>
                                                    </div>
                                                </div>
                                                <!-- 状态 -->
                                                <div class="form-group">
                                                    <label class="control-label col-md-2">状态<span class="required">*</span></label>
                                                    <div class="col-md-6" style="margin-left: 18px;">
                                                        <div class="radio-list">
                                                            <?php if ( (! $add && $info['status'] == 3 ) || $add):?>
                                                                <label class="radio-inline"><input name="status" checked value="3" type="radio"> 草稿 </label>
                                                            <?php endif;?>
                                                            <label class="radio-inline"><input name="status" <?php if( ! $add && $info['status'] == 2):?> checked <?php endif;?> value="2" type="radio"> 上架 </label>
                                                            <label class="radio-inline"><input name="status" <?php if( ! $add && $info['status'] == 1):?> checked<?php endif;?> value="1" type="radio"> 下架 </label>
                                                        </div>
                                                    </div>
                                                </div>
                                                <!-- 状态 -->
                                                <div class="form-group">
                                                    <label class="control-label col-md-2">是否精品<span class="required">*</span></label>
                                                    <div class="col-md-6" style="margin-left: 18px;">
                                                        <div class="radio-list">
                                                            <label class="radio-inline"><input name="is_best" <?php if( ! $add && $info['is_best'] == 2):?> checked <?php elseif($add):?> checked <?php endif;?> value="2" type="radio"> 精品 </label>
                                                            <label class="radio-inline"><input name="is_best" <?php if( ! $add && $info['is_best'] == 1):?> checked<?php endif;?> value="1" type="radio"> 普通 </label>
                                                        </div>
                                                    </div>
                                                </div>
                                                <!-- 状态 -->
                                                <div class="form-group">
                                                    <label class="control-label col-md-2">是否新品<span class="required">*</span></label>
                                                    <div class="col-md-6" style="margin-left: 18px;">
                                                        <div class="radio-list">
                                                            <label class="radio-inline"><input name="is_new" <?php if( ! $add && $info['is_new'] == 2):?> checked <?php elseif($add):?> checked <?php endif;?> value="2" type="radio"> 新品 </label>
                                                            <label class="radio-inline"><input name="is_new" <?php if( ! $add && $info['is_new'] == 1):?> checked<?php endif;?> value="1" type="radio"> 普通 </label>
                                                        </div>
                                                    </div>
                                                </div>
                                                <!-- 状态 -->
                                                <div class="form-group">
                                                    <label class="control-label col-md-2">是否热销<span class="required">*</span></label>
                                                    <div class="col-md-6" style="margin-left: 18px;">
                                                        <div class="radio-list">
                                                            <label class="radio-inline"><input name="is_hot" <?php if( ! $add && $info['is_hot'] == 2):?> checked <?php elseif($add):?> checked <?php endif;?> value="2" type="radio"> 热销 </label>
                                                            <label class="radio-inline"><input name="is_hot" <?php if( ! $add && $info['is_hot'] == 1):?> checked<?php endif;?> value="1" type="radio"> 普通 </label>
                                                        </div>
                                                    </div>
                                                </div>
                                                <!-- 轮播图 -->
                                                <div class="form-group">
                                                    <label class="control-label col-md-2">相册<span class="required">*</span></label>
                                                    <div class="col-md-6">
                                                        <div id="uploader-demo">
                                                            <!--用来存放item-->
                                                            <div class="uploader-list">
                                                                <?php if (! $add && $info['imgs']): foreach ($info['imgs'] as $v):?>
                                                                    <div id="" class="file-item thumbnail pic-list">
                                                                        <img src="<?php echo $v; ?>">
                                                                        <a title="删除" class="delete-btn hide" href="javascript:void(0);" style="color:#b94a48;position:absolute;top:-10px;right:-5px;background-color:#ffff;height:17px;width:15px;font-size:12px;padding:2px;">
                                                                            <i class="fa fa-times"></i>
                                                                        </a>
                                                                        <input name="images[]" type="hidden" class="file-name" value="<?php echo $v; ?>">
                                                                    </div>
                                                                <?php endforeach; endif;?>
                                                                <div id="filePicker" class="file-item thumbnail webuploader-container">
                                                                    <div class="webuploader-pick">
                                                                        <div style="position:absolute;top:0;left:0;width:100%;height:100%;padding-top:50px;color:grey;">选择图片</div>
                                                                        <img title="选择上传图片" src="<?php echo getDefaultImg(); ?>">
                                                                    </div>
                                                                    <div id="rt_rt_1c2t7atu83351ra0bvm7gcgnu1" style="position: absolute; top: 4px; left: 4px; width: 100px; height: 100px; overflow: hidden; bottom: auto; right: auto;">
                                                                        <input type="file" name="file" class="webuploader-element-invisible" multiple="multiple" accept="image/*">
                                                                        <label style="opacity: 0; width: 100%; height: 100%; display: block; cursor: pointer; background: rgb(255, 255, 255);">
                                                                        </label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <script type="text/javascript">
                                                                $(function(){
                                                                    var n = "<?php echo !$add ? 3-count($info['imgs']) : 3?>";
                                                                    uploadImg({
                                                                        box:'#uploader-demo',
                                                                        uploadBtn:"#filePicker",
                                                                        fileName:'images[]',
                                                                        width:110,  //显示缩略图宽带
                                                                        uploadUrl:'<?php echo getUrl('shop/government/uploadImgs');?>',
                                                                        height:100,	//显示缩略图高度
                                                                        number:n
                                                                    });
                                                                });
                                                            </script>
                                                        </div>
                                                    </div>
                                                </div>

                                                <!-- 按钮 -->
                                                <div class="form-group">
                                                    <div class="col-md-offset-2 col-md-9" style="padding-left: 0;">
                                                        <a class="btn blue button-next" href="javascirpt:void(0);" data-toggle="tab" >继续 <i class="m-icon-swapright m-icon-white"></i></a>
                                                    </div>
                                                </div>
                                                <script type="text/javascript">
                                                    $(function(){
                                                        $('.button-next').click(function(){
                                                            $('[href="#tab_1_2"]').click();
                                                        });

                                                        $('[dp]').not("[noinit]").datepicker({
                                                            changeMonth: true,
                                                            autoclose: true,
                                                            format: "yyyy-mm-dd",
                                                            language: 'zh-CN'
                                                        });
                                                    });
                                                </script>
                                                <!--  -->
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <!--商品规格-->
                                <div class="tab-pane" id="tab_1_2">
                                    <div class="table-actions-wrapper " style="float: right"></div>
                                    <div class="table-responsive">
                                        <div class="table-container">
                                            <!-- 开始 -->
                                            <div class="form-body" id="property_option">
                                                <?php if($add || empty($property)){?>
                                                    <div class="row option property">
                                                        <label class="col-md-2 control-label">标签名称<span class="required">*</span></label>
                                                        <div class="col-md-2">
                                                            <div class="form-group">
                                                                <div class="col-md-12">
                                                                    <select name="lable[0][lable]" class="form-control required select2 lable" option="0">
                                                                        <option value="0">请选择标签属性</option>
                                                                        <?php foreach ($attribute as $v):?>
                                                                            <option value="<?php echo $v['attr_name']?>" data-id="<?php echo $v['attr_id']?>" data-type="<?php echo $v['attr_input_type']?>"><?php echo $v['attr_name']?></option>
                                                                        <?php endforeach;?>
                                                                    </select>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="col-md-3">
                                                            <div class="form-group">
                                                                <div class="col-md-12 lableV">
                                                                    <input type="hidden" id="select2_sample0" name="lable[0][value][]" class="form-control select2 required" value="">
        <!--                                                            <span class="help-block">-->
        <!--                                                                <code>输入属性名称</code>-->
        <!--                                                            </span>-->
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="col-md-1">
                                                            <div class="form-group">
                                                                <div class="col-md-12">
                                                                    <div style="margin-top: 10px;">
                                                                        <a href="javascript:void(0);" class="add-option-btn"><img src="<?php echo $this->staticUrl;?>img/4.png" class="add-btn1"> 添加</a>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                <?php }else{$attributeArr = array(); foreach ($property as $k=>$vp){?>
                                                    <div class="row option property">
                                                        <label class="col-md-2 control-label">标签名称<span class="required">*</span></label>
                                                        <div class="col-md-2">
                                                            <div class="form-group">
                                                                <div class="col-md-12">
                                                                    <select name="lable[<?php echo $k?>][lable]" class="form-control required select2 lable" option="0">
                                                                        <?php $type = 3; $attrId = 0; foreach ($attribute as $v): if ($k == 0){$attributeArr[] = $v['attr_name'];}?>
                                                                            <option value="<?php echo $v['attr_name']?>" data-id="<?php echo $v['attr_id']?>" <?php if ($v['attr_name'] == $vp['lable']): $type = $v['attr_input_type'];$attrId = $v['attr_id'];?>selected<?php endif;?> data-type="<?php echo $v['attr_input_type']?>"><?php echo $v['attr_name']?></option>
                                                                        <?php endforeach; if (!in_array($vp['lable'], $attributeArr)):?>
                                                                            <option value="<?php echo $vp['lable']?>" class="is_null_option"><?php echo $v['attr_name']?></option>
                                                                        <?php endif; ?>
                                                                    </select>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="col-md-3">
                                                            <div class="form-group">
                                                                <div class="col-md-12 lableV">
                                                                    <?php   if ($type == 1):?>
                                                                        <input type="hidden" id="select2_sample<?php echo $k?>" name="lable[<?php echo $k?>][value][]" class="form-control select2 required" value="<?php echo (! $add) ? implode(',', $vp['value']) : ''?>">
                                                                    <?php elseif ($type == 2):?>
                                                                        <select name="lable[<?php echo $k?>][value][]" class="form-control required select2" multiple>
                                                                            <?php $propertyAttributeV = json_decode($attributeV, true); foreach ($propertyAttributeV[$attrId] as $key => $obj):?>
                                                                                <option <?php if (in_array($obj, $vp['value'])):?> selected <?php endif;?> value="<?php echo $obj?>"><?php echo $obj?></option>
                                                                            <?php endforeach;?>
                                                                        </select>
                                                                    <?php elseif ($type == 3):?>
                                                                        <textarea  class="form-control required" name="lable[<?php echo $k?>][value][]" ><?php echo (! $add) ? implode(',', $vp['value']) : ''?></textarea>
                                                                    <?php endif;?>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="col-md-1">
                                                            <div class="form-group">
                                                                <div class="col-md-12">
                                                                    <div style="margin-top: 10px;">
                                                                    <?php if($k){?>
                                                                        <a href="javascript:void(0);" class="remove_option"><img src="<?php echo $this->staticUrl;?>img/2.png" alt=""></a>
                                                                    <?php }else{?>
                                                                        <a href="javascript:void(0);" class="add-option-btn"><img src="<?php echo $this->staticUrl;?>img/4.png" class="add-btn1"> 添加</a>
                                                                    <?php }?>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                        </div>
                                                    </div>
                                                <?php }}?>
                                            </div>
                                            <script type="text/javascript">
                                                $(function(){
                                                    var attributeV = eval(<?php echo $attributeV?>);
                                                    var attribute = eval(<?php echo json_encode($attribute)?>);
                                                    var attributeH = '';
                                                    $.each(attribute, function (key, obj) {
                                                        attributeH += '<option value="'+obj.attr_name+'" data-id="'+obj.attr_id+'" data-type="'+obj.attr_input_type+'">'+obj.attr_name+'</option>';
                                                    });
//                                                            $("#select2_sample<?php //echo $k?>//").select2({
//                                                                tags: []
//                                                            });
                                                    $("select").select2();

                                                    /**
                                                     * 选择标签属性
                                                     */
                                                    $(".lable").live('change',function () {
                                                        var type = $(this).find("option:selected").attr('data-type');
                                                        var vl = $(this).find("option:selected").attr('data-id');
                                                        var option = $(this).attr('option');
                                                        $(this).find('.is_null_option').remove();
                                                        var html = '';
                                                        if (type == 2){
                                                            // 选择输入
                                                            html = '<select name="lable['+option+'][value][]" class="form-control required select2" multiple>';
                                                            $.each(attributeV[vl],function (key, obj) {
                                                                html += '<option value="'+obj+'">'+obj+'</option>';
                                                            });
                                                            html += '</select>';
                                                        }else if(type == 3){
                                                            // 多行文本框输入
                                                            html += '<textarea  class="form-control required" name="lable['+option+'][value][]" ></textarea>';
                                                        }else if(type == 1){
                                                            // 文本框输入
                                                            html += '<input type="hidden" id="select2_sample'+option+'" name="lable['+option+'][value][]" class="form-control select2 required" value="">';
                                                        }
                                                        $(this).parents('.option').find('.lableV').html(html);
                                                        $("select").select2();
                                                    });

                                                    var option = <?php echo $add ? 1 : count($property) ?>;
                                                    $("#select2_sample0").select2({
                                                        tags: []
                                                    });

                                                    $('.add-option-btn').click(function(){
                                                        if($(".property").length >= 5){
                                                            show_message({status:0,message:"最多只能添加5个"});
                                                            return;
                                                        }
                                                        var deleteImg = "<?php echo $this->staticUrl;?>img/2.png";
                                                        var html = '<div class="row option property">';
                                                        html +='<label class="col-md-2 control-label">标签名称<span class="required">*</span></label>';
                                                        html +='<div class="col-md-2">';
                                                        html +='<div class="form-group">';
                                                        html +='	<div class="col-md-12">'+
                                                                        '<select name="lable['+option+'][lable]" class="form-control required select2 lable" option="'+option+'">'+
                                                                            '<option value="0"> 请选择标签属性</option>'+attributeH+
                                                                        '</select>';
                                                        html +='	</div>';
                                                        html +='</div>';
                                                        html +='</div>';
                                                        html +='<div class="col-md-3">';
                                                        html +='	<div class="form-group">'
                                                        html +='		<div class="col-md-12 lableV">'
                                                        html +='			<input type="text" id="select2_sample'+option+'" name="lable['+option+'][value]" class="form-control select2 required" value="">'
//                                                        html +='			<span class="help-block">'
//                                                        html +='				<code>输入属性名称</code>'
//                                                        html +='			</span>'
                                                        html +='		</div>'
                                                        html +='	</div>'
                                                        html +='</div>'
                                                        html +='<div class="col-md-1">'
                                                        html +='	<div class="form-group">'
                                                        html +='		<div class="col-md-12">'
                                                        html +='			<div style="margin-top: 5px;">'
                                                        html +='				<a href="javascript:void(0);" class="remove_option"><img src="'+deleteImg+'" alt=""></a>';
                                                        html +='			</div>'
                                                        html +='		</div>'
                                                        html +='	</div>'
                                                        html +='</div>'
                                                        html +='</div>'

                                                        $('#property_option').append(html);
                                                        $("select").select2();
//                                                        $("#select2_sample"+option).select2({
//                                                            tags: []
//                                                        });
                                                        option++;
                                                    });



                                                    $('.remove_option').live('click',function(){
                                                        $(this).parents('.option').remove();
                                                    })
                                                })
                                            </script>
                                                           <!-- 按钮 -->
                                               <div class="form-group">
                                                    <div class="col-md-offset-2 col-md-9" style="padding-left: 0;">
                                                        <a class="btn blue button-next btn_variant" href="javascirpt:void(0);" data-toggle="tab" >继续 <i class="m-icon-swapright m-icon-white"></i></a>
                                                    </div>
                                                </div>
                                                <script type="text/javascript">
                                                    $(function(){
                                                        $('.btn_variant').click(function(){
                                                            $('[href="#tab_1_3"]').click();
                                                        });
                                                    });
                                                </script>

                                                <!--  -->
                                            <!-- 结束 -->
                                        </div>
                                    </div>
                                </div>

                                <!--商品详情-->
                                <div class="tab-pane" id="tab_1_3">
                                    <div class="table-actions-wrapper " style="float: right"></div>
                                    <div class="table-responsive">
                                        <div class="table-container">
                                            <div class="form-body">
                                                <!-- 图片结束 -->
                                                <div class="form-group" id="add-btn">
<!--                                                    <label class="col-md-2 control-label"></label>-->
                                                    <div class="col-md-12">
                                                        <script id="content" name="detail" type="text/plain" ><?php echo ! $add ? $info['detail'] : '' ; ?></script>
                                                    </div>
                                                    <script type="text/javascript">
                                                        $(function(){
                                                            $.e_validate.init('.form-horizontal',{});
                                                            UE.getEditor('content',{initialFrameWidth:"100%",initialFrameHeight:'500',autoHeightEnabled:false,serverUrl:'<?php echo getUrl('material/home/editor');?>'});
                                                        });
                                                    </script>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <div class="col-md-offset-2 col-md-9" style="padding-left: 0;">
                                                    <input name="id" value="<?php echo ! $add ? $info['id'] : '';?>" type="hidden">
                                                    <button class="btn green"><i class="fa fa-save"></i> 保存</button>
                                                    <a class="btn default seach-btn" href="<?php echo getUrl('member/consumer');?>"><i class="fa fa-chevron-left"></i> 返回</a>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
	            </div>
            </div>
        </div>
    </div>
</div>
<div class="content-box" type="0" index="0">
    <script index="0" id="" name="free_content[]" type="text/plain"></script>
</div>
<script type="text/javascript">
    $(function(){
        $.e_validate.init('#main-form', {});
    });
</script>
</body>
</html>